<%@page import="edcom.server.SQLInsertException"%>
<%@page import="edcom.server.StudentManager"%>
<%@page import="edcom.client.Student"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>insertStudent</title>
</head>
<body>
<h1>TESTBENCH</h1>
<h3>insertStudent()</h3>
<a href="index.jsp">RETURN</a>
<br /><br />

Since insertStudent() will only be used when all of the inputs <br/>
are known to be well formed, only plausible test cases (at the moment) <br/>
is a good insert and inserting a duplicate.
<br/><br/>
(DevTeam, please clear tables first before running.)

<br/><br/>
<h4>Results</h4>

good insert: 
<%

String msg = "";

Student std = new Student();
std.setName("Kasumi Staedtler");
std.setStudentNumber("2008-21670");
std.setUserName("december10_1991");
std.setPassword("annihilium");
std.setEmail("kasumistaedtler@gmail.com");
std.setMajor("BS Applied Psionics, maj. Meta-Layers");

StudentManager mgr = new StudentManager();
try{
	mgr.insertStudent(std);
}catch(SQLInsertException e){
	msg = e.getMessage();
}catch(Exception e){
	msg = "GENERAL ERROR: " + e.getMessage();
}

if(msg == "") out.println("{no error}");
else out.println(msg);
%><br/><br/>
repeat insert: 
<%
try{
	mgr.insertStudent(std);
}catch(SQLInsertException e){
	msg = e.getMessage();
}catch(Exception e){
	msg = "GENERAL ERROR: " + e.getMessage();
}

if(msg == "") out.println("{no error}");
else out.println(msg);
%>
</body>
</html>